package com.cherish.quartz.job;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.quartz.Job;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class MyJob1 implements Job {

	private static int count = 0;

	public void execute(JobExecutionContext context) throws JobExecutionException {
		Date date = new Date();
		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

		count++;
		JobDataMap dataMap = context.getJobDetail().getJobDataMap();
		System.out.println(sf.format(date) + "任务1第" + count + "次执行\n作者是：" + dataMap.getString("author") + "\n内容为："
				+ dataMap.getString("description"));
	}

}
